package com.dmjj.dmjjxt.service.impl;

import com.dmjj.common.base.BaseMapper;
import com.dmjj.common.base.BaseServiceImpl;
import com.dmjj.dmjjxt.dao.BrandMapper;
import com.dmjj.dmjjxt.dto.BrandDTO;
import com.dmjj.dmjjxt.dto.BrandPicDTO;
import com.dmjj.dmjjxt.service.BrandService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;


/**
 * 品牌信息表业务处理接口
 * @Author zhangxue
 * @Date 2019-04-11 14:13:52
 */
@Service
public class BrandServiceImpl extends BaseServiceImpl<BrandDTO, Long> implements BrandService {

    private static final Log LOGGER = LogFactory.getLog(BrandServiceImpl.class);

    @Autowired
    private BrandMapper mapper;

    @Override
    protected BaseMapper<BrandDTO, Long> getMapper() {
        return mapper;
    }

    /**
     * 品牌信息表列表
     * @Author zhangxue
     * @Date 2019-04-11 14:13:52
     * @Param
     * @Return
     */
    @Override
    public List<BrandDTO> list4Page(BrandDTO entity, Integer pageNum, Integer... pageSize) {
        return super.list4Page(entity, pageNum, pageSize);
    }

    /**
     * 品牌信息表列表（无分页）
     * @Author zhangxue
     * @Date 2019-04-11 14:13:52
     * @Param
     * @Return
     */
    @Override
    public List<BrandDTO> listByCondition(BrandDTO entity) {
        return super.listByCondition(entity);
    }

    /**
     * 查询品牌信息表详情信息
     * @Author zhangxue
     * @Date 2019-04-11 14:13:52
     * @Param
     * @Return
     */
    @Override
    public BrandDTO queryOneByPk(Long id) {
        return super.queryOneByPk(id);
    }

    /**
     * 保存品牌信息表信息
     * @Author zhangxue
     * @Date 2019-04-11 14:13:52
     * @Param
     * @Return
     */
    @Override
    @Transactional
    public Long save(BrandDTO entity) {
        return super.save(entity);
    }

    /**
     * 删除品牌信息表信息
     * @Author zhangxue
     * @Date 2019-04-11 14:13:52
     * @Param
     * @Return
     */
    @Override
    @Transactional
    public Integer delete(Long id) {
        return super.delete(id);
    }

    @Override
    public List<Map<String,Object>> queryAllBrandNameAndNo(BrandDTO entityDTO) {
        return mapper.queryAllBrandNameAndNo(entityDTO);
    }

    @Override
    public BrandDTO queryBrandInfoByBrandNo(BrandDTO entityDTO) {
        return mapper.queryBrandInfoByBrandNo(entityDTO);
    }

    @Override
    public List<BrandDTO> queryBrandInfoByName(BrandDTO entityDTO) {
        return mapper.queryBrandInfoByName(entityDTO);
    }

    @Override
    public Integer deleteBrand(String brandno) {
        return mapper.deleteBrand(brandno);
    }

    @Override
    public List<Map<String, Object>> queryContractInfoByBrandNo(String brandno) {
        return mapper.queryContractInfoByBrandNo(brandno);
    }

    @Override
    public Integer saveBrandPic(BrandPicDTO brandPicDTO) {
        return mapper.saveBrandPic(brandPicDTO);
    }

    @Override
    public List<BrandPicDTO> queryBrandPicInfo(BrandPicDTO entityDTO) {
        return mapper.queryBrandPicInfo(entityDTO);
    }

    @Override
    public Integer deleteBrandPicById(BrandPicDTO entityDTO) {
        return mapper.deleteBrandPicById(entityDTO);
    }
}
